<div class="page page-table citas">

    <div class="row ui-section" data-ng-controller="listarCitasCtrl">
        <div class="col-lg-8 clearfix">
            <h2 class="section-header" data-translate="CITAS"></h2>
        </div>
        <div class="col-md-12">
            <section class="panel panel-default table-dynamic" ng-init="loadCalendar()">
                <div id='calendar'></div>
            </section>
        </div>

        <!-- Modal -->
        <div class="modal fade" id="dataModalCitas" tabindex="-1" role="dialog" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">Citas</br>{{modal.fecha}}</h4>
              </div>
              <div class="modal-body">

                <form id="frmRegistrarCita" role="form" name="frmRegistrarCita" ng-submit="registrarCita()">

                    <div class="form-group">
                        <label>Seleccione el tipo de cita:</label>
                        <md-input-container>
                            <select required ng-model="cita.IdTipoCita" placeholder="Tipos de Cita" >
                                <option ng-repeat ="tipos in tiposCitas" value="{{tipos.Id}}">{{tipos.Descripcion}}</option>
                            </select>
                        </md-input-container>
                    </div>

                    <div class="form-group">
                        <label>Seleccione el encargado:</label>
                        <md-input-container>
                            <select required ng-model="cita.IdEncargado" placeholder="Encargado" >
                                <option ng-repeat="funcionario in funcionarios" value="{{funcionario.Id}}">{{funcionario.Nombre}} {{funcionario.PApellido}} {{funcionario.SApeliido}}</option>
                            </select>
                        </md-input-container>
                    </div>

                    <div class="form-group">
                        <label>Seleccione el cliente:</label>
                        <md-input-container>
                            <select required ng-model="cita.IdCliente" placeholder="Cliente" >
                                <option ng-repeat="cliente in clientes" value="{{cliente.Id}}">{{cliente.Nombre}} {{cliente.PApellido}} {{cliente.SApeliido}}</option>
                            </select>
                        </md-input-container>
                    </div>

                    <div class="form-group">
                        <md-input-container>
                            <label for="numeroSerie">Notas</label>
                            <input md-maxlength="200" required name="notas" ng-model="cita.Notas">
                            <div ng-messages="frmRegistrarCita.notas.$error">
                                <div ng-message="required"><span data-translate="GENERIC_FORM_ERROR_REQUIRED"></span></div>
                                <div ng-message="md-maxlength"><span data-translate="GENERIC_FORM_ERROR_TOO_LONG"></span></div>
                            </div>
                        </md-input-container>
                    </div>

                </form>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button form="frmRegistrarCita" type="submit" class="btn btn-primary">Guardar</button>
              </div>
            </div>
          </div>
        </div>

    </div>

</div>